const request = require("request");
const { BASE_URL } = require("./config");

module.exports = (req, res) => {
  const url = BASE_URL + "/explore/guessYouLike";
  request(
    {
      url,
      headers: {
        "xm-sign": req.sign,
      },
    },
    (error, response, body) => {
      if (error) {
        console.log("error aa", error);
        res.status(500).json({
          ret: 0,
          message: "猜你喜欢请求失败",
          data: error,
        });
      } else {
        res.status(response.statusCode).json(JSON.parse(body));
      }
    }
  );
};
